package com.jing.mapper;

import com.jing.pojo.ReservationInfo;
import com.jing.pojo.UserReservationInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author 陈书憬
 * @version 1.0
 * 2024/9/24
 */
@Mapper
public interface UserLogMapper {

    @Select("select names from user_reservation_log where user_id = #{userId}")
    List<UserReservationInfo> getRoomNames(Integer userId);

    List<UserReservationInfo> getUserLogList(Integer userId, String names, String state);

    @Insert("insert into user_reservation_log (names, type, seat_id, floor, area, start_time, end_time, check_in_time, check_out_time, user_id, reservation_status,name_id, option_date) values (#{name}, #{type}, #{seatId}, #{floor}, #{area}, #{startTime}, #{endTime}, #{checkInTime}, #{checkOutTime}, #{userId},#{reservationStatus} ,#{nameId}, #{optionDate});")
    void add(ReservationInfo reservationInfo);

    void setSeatStatus(Integer userId, String reservationStatus);

    List<UserReservationInfo> getAllUserLogList(String names, String state);


//
}
